package com.itheima.demo6collection;

import java.util.ArrayList;

public class CollectionTraversalDemo4 {
    public static void main(String[] args) {
//        目标：掌握Collection集合的遍历方式二：增强for遍历
        ArrayList<String> names = new ArrayList<>();
        names.add("张三");
        names.add("李四");
        names.add("王五");
        names.add("赵六");
        for (String name : names) {
            System.out.println(name);
        }
        System.out.println("=================");
        String[] users={"张三","李四","王五","赵六"};
        for (String user : users) {
            System.out.println(user);
        }
    }
}
